<?php

namespace frontend\controllers;

use yeesoft\post\models\Post;
use yeesoft\post\models\Tag;
use Yii;
use yii\data\Pagination;
use yii\web\NotFoundHttpException;

/**
 * Site controller
 */
class TestController extends \yeesoft\controllers\BaseController
{
    public $freeAccess = true;

    public function actionIndex()
    {
        $mail = \Yii::$app->mailer->compose()
            ->setFrom(['18817931598@163.com' => 'Yii 中文网'])
            ->setTo('18817931598@qq.com')
            ->setSubject('邮件发送配置')
            //->setTextBody('Yii中文网教程真好 www.yii-china.com')   //发布纯文字文本
            ->setHtmlBody("<br>Yii中文网教程真好！www.yii-china.com")    //发布可以带html标签的文本
            ->send();
        if($mail)
            echo 'success';
        else
            echo 'fail';
    }


}
